import request from '@/utils/request'
// 本地单图上传地址
export const SingleImageUploadApi = process.env.VUE_APP_API_BASE_URL + '/file/image'
// export const MultipleImageUploadApi = process.env.VUE_APP_API_BASE_URL + '/image/attachment/multiple'

// 阿里云OSS policy获取接口
export function fetchAliyunOSSPolicy(params) {
  return request({
    url: '/attachment/aliyunoss/policy',
    method: 'GET',
    params: params
  })
}
export function postMaterial(file, moduleName = 'common') {
  let formdata = new FormData()
  formdata.append('file', file)
  formdata.append('module', moduleName)
  let headers = {
    'Content-Type': 'multipart/form-data'
  }
  return request({
    url: '/attachment/file/single',
    method: 'POST',
    headers: headers,
    data: formdata
  })
}
export default {}
